package com.os.ordersystem.service.impl;

import com.os.ordersystem.bean.Order;
import com.os.ordersystem.bean.OrderInfo;
import com.os.ordersystem.mapper.OrderMapper;
import com.os.ordersystem.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public int add(Order order) {
        orderMapper.add(order);
        return order.getId();
    }


    @Override
    public int payOrder(Integer id) {
        return orderMapper.payOrder(id);
    }

    @Override
    public int del(Integer id) {
        return orderMapper.del(id);
    }


    @Override
    public List<Order> getByPage(Map<String, Object> map) {
        return orderMapper.getByPage(map);
    }

    @Override
    public long getTotal(String name) {
        return orderMapper.getTotal(name);
    }

    @Override
    public List<Order> getByPageC(Map<String, Object> map) {
        return orderMapper.getByPageC(map);
    }

    @Override
    public long getTotalC(Integer id) {
        return orderMapper.getTotalC(id);
    }
}
